home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / editor / frexxed / fpl / samename.fpl < prev    next >
Text File  |  1995-07-18  |  692b  |  22 lines

  1.  
  2. export int SameName_hook(string filename, int BufferID)
  3. {
  4.   int ret=0;
  5.  
  6.   if (!Stricmp(filename, ReadInfo("full_file_name", BufferID))) {
  7.     ret=Request(joinstr("Do you want to load '", filename, "' again?"), "Same path!", "Yes!|..and kill the old!|Activate the old!|Ooops!");
  8.     if (ret==2)
  9.       Clean(joinstr("Kill(", itoa(BufferID), ");"));
  10.   } else {
  11.     ret=Request(joinstr("Do you want to load another file\ncalled '", ReadInfo("file_name", BufferID), "' ?"), "Same name!", "Why not!|Not in this life!");
  12.   }
  13.   if (ret==3) {
  14.     ExecuteLater(joinstr("CurrentBuffer(Activate(GetEntryID(\"", filename, "\")));"));
  15.     ret=0;
  16.   }
  17.   return(!ret);
  18. }
  19.  
  20.  
  21. Hook("SameName", "SameName_hook");
  22.